-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests #620
base: develop
Are you sure you want to change the base?
add tests #620
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the getHumanAge
function! 🎉 The code meets the task requirements and constraints, and the test cases are well-structured to cover various scenarios. While there are some minor issues with the test descriptions, they don't impact the functionality of your solution. Keep up the good work, and consider refining the test descriptions for clarity in future projects. 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -7,4 +7,37 @@ describe('getHumanAge', () => { | |||
expect(getHumanAge) | |||
.toBeInstanceOf(Function); | |||
}); | |||
|
|||
test('should return 0, if animalAge less than first', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test description mentions 'animalAge less than first', but it should specify that both catAge
and dogAge
are less than 15, which is the threshold for the first human year according to the task description.
expect(result).toEqual([0, 0]); | ||
}); | ||
|
||
test(`should return 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test description is unclear. It should specify that catAge
and dogAge
are between 15 and 24, which corresponds to 1 human year according to the task description.
expect(result).toEqual([1, 1]); | ||
}); | ||
|
||
test(`should return 2, if animalAge equal (first + second)`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test description should specify that catAge
and dogAge
are exactly 24, which corresponds to 2 human years according to the task description.
expect(result).toEqual([2, 2]); | ||
}); | ||
|
||
test(`should return correct value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test description should specify that catAge
and dogAge
are more than 24, which corresponds to more than 2 human years according to the task description.
expect(result).toEqual([3, 2]); | ||
}); | ||
|
||
test(`should return correct value, if one animalAge equal (first + second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo in the test description: 'animalAgemore' should be 'animalAge more'. Additionally, the description should clarify that one of the ages is exactly 24 and the other is more than 24.
No description provided.